// pkgTask/components/search-list/index.js
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        columnList:{
            type:Array,
            value:[]
        },
        columnListAll:{
            type:Array,
            value:[]
        },
        ifShow:{
            type:Boolean,
            value:false
        }
    },

    /**
     * 组件的初始数据
     */
    data: {

    },

    /**
     * 组件的方法列表
     */
    methods: {
        onClose(){
            this.setData({
                ifShow:false
            })
        },
        changeKeywords(e){
            let that = this
            if (e.detail) {
                let listItemList = that.data.columnListAll.filter(item => item.label.indexOf(e.detail) != -1)
                that.data.columnList = JSON.parse(JSON.stringify(listItemList))
                that.setData({
                    columnList: that.data.columnList
                })
            } else {
                that.setData({
                    columnList: JSON.parse(JSON.stringify(that.data.columnListAll))
                })
            }
        },
        btnClick(e){
            this.triggerEvent('okClick', e.currentTarget.dataset)   
        }
    }
})
